﻿#ifndef SCREENSHOT_H
#define SCREENSHOT_H

#include <functional>
#include <QPixmap>

struct CaptureCB {
    std::function<void(QPixmap)> forwordCB;
    std::function<void(int)> finishCB; // code = 0 截图成功，1 取消，2 保存，3 转发
};

struct ImageEditCB {
    std::function<void(QPixmap)> forwordCB;
    std::function<void(int)> finishCB; // code = 0 编辑成功，1 取消，2 保存，3 转发
};

//  QMetaObject::invokeMethod(obj,"cancel"); //调用端主动放弃操作
QObject* startCapture(CaptureCB cb);

QObject* startEdit(QString path,ImageEditCB cb);

#endif // SCREENSHOT_H
